package com.example.servletdemo.mvc.service.impl;

import com.example.servletdemo.model.Result;
import com.example.servletdemo.mvc.dao.inter.UserDaoInter;
import com.example.servletdemo.mvc.model.Student;
import com.example.servletdemo.mvc.service.inter.StudentServiceInter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class StudentServiceImpl implements StudentServiceInter {
    @Resource
    UserDaoInter userDaoInter;

    @Override
    public Student getStuInfo(int id) {
        Student student = new Student();
        student.setId(id);
        student.setAge(25);
        student.setName("学生："+id);
        return student;
    }

    @Override
    public Result getStudentInfo(int id) {
        Student studentInfo = userDaoInter.getStudentInfo(id);
        Result result = new Result();
        result.setObject(studentInfo);
        result.setSuccess(true);
        return result;
    }
}
